<?php
$text =
<fieldset>
  			<legend>Paveiksliuko pasirinkimas:</legend>
  			<center>$vimg</center>
  			<form name=\"avatar_change\" action=\"\" method=\"post\">
  			<table border=0 width=100%>
  				<tr>
  					<td align='left' width='10%'>Kategorija:</td>
  					<td><select size=\"1\" name=\"dir\">";
  						$tdir = "./images/avatars";
  						$dir = opendir("./images/avatars");
						while ($dira = readdir($dir)) {
							if (is_dir($tdir."/".$dira) && $dira != "." && $dira != "..") {
								$text .= "<option value='" . $dira ."'>$dira</option>\n";
							}
						}
					$text .= "</select>
					</td>
				</tr>
			</table>
			<input type=\"submit\"  value=\"Pasirinkti\">
			<input type=\"hidden\" name=\"action\"  value=\"avatar_change\" />
			</form>
			</fieldset>
";
//$sql = mysql_fetch_assoc(mysql_query("SELECT `avatar` FROM users WHERE `nick`='" . $_SESSION['username'] ."'"));
//$vimg = "<img src='" . $sql['avatar'] ."'></img>";
?>